package com.ss.android.article.base.app.setting;

import android.content.SharedPreferences;
import android.support.annotation.Keep;
import android.text.TextUtils;

import org.json.JSONException;
import org.json.JSONObject;

@Keep
public class AbSettings$$Impl extends AbSettings {
    public AbSettings$$Impl() {

    }

    private boolean jsonEquals(Object arg4, Object arg5) {
        boolean v0 = true;
        if (arg4 != arg5) {
            int v2 = arg4 == null ? 1 : 0;
            int v0_1 = 1;
            if (arg5 != null) {
                v0_1 = 0;
            }

            if ((v0_1 ^ v2) != 0) {
                return false;
            }

            v0 = arg4.toString().equals(arg5.toString());
        }

        return v0;
    }

    public void loadData(SharedPreferences sharedPreferences) {
        super.loadData(sharedPreferences);
        this.mIsGalleryFlat = sharedPreferences.getInt("is_gallery_laied_flat", 0);
        this.mIsShowWatermark = sharedPreferences.getInt("is_show_watermark", 0);
        this.mIsVideoMultiResolutionEnabled = sharedPreferences.getInt("video_multi_resolution_enabled", 0);
        this.mIsVideoDiagnosisEnabled = sharedPreferences.getInt("video_play_diagnosis_enabled", 0);
        this.mIsVideoRelatedButtonEnabled = sharedPreferences.getInt("video_detail_comment_button_new", 0);
        this.mIsVideoDetailRelatedBackStackEnabled = sharedPreferences.getInt("video_detail_related_back_stack", 0);
        this.videoRecDetailAd = sharedPreferences.getInt("video_rec_detail_ad", 0);
        this.mIsLoadImage4G = sharedPreferences.getInt("is_show_big_image_4g", 1);
        this.mEnableArticleRecord = sharedPreferences.getInt("article_read_position_enable", 1);
        this.mIsEnableImmeresedStatusBar = sharedPreferences.getInt("enable_lite_immersed_status_bar", 1);
        this.mIsFeedBackWithVideoLog = sharedPreferences.getInt("feed_back_with_video_log", 0);
        this.mTcpReadTimeOut = sharedPreferences.getInt("tcp_read_time_out", 0);
        this.mOpenVideoCdnStatistics = sharedPreferences.getInt("video_cdn_statistics", 0);
        this.mOpenVideoCdnIpEnable = sharedPreferences.getInt("video_cdn_module_enable", 0);
        this.mIsTitleBold = sharedPreferences.getInt("bold_font_flag", 0);
        this.mVideoFixOnLineQuestionFlag = sharedPreferences.getInt("open_video_fix_online_question", 1);
        this.mFixLoadMore = sharedPreferences.getInt("fix_load_more", 1);
        this.mRefreshGuideInterval = sharedPreferences.getInt("user_refresh_guide_interval", 0);
        this.mUserRefreshGuideType = sharedPreferences.getInt("user_refresh_guide_type", 0);
        this.mVideoFinishNewUI = sharedPreferences.getInt("video_finish_new_ui", 1);
        this.mPersisitVivoMultiWindow = sharedPreferences.getInt("persist_vivo_multi_window", 1);
        this.mVideoUseIpUrl = sharedPreferences.getInt("video_use_ip_url", 0);
        this.mVideoAutoPlay = sharedPreferences.getString("tt_lite_video_auto_play", "{}");
        this.mUpdateJs = sharedPreferences.getInt("tt_lite_update_js", 0);
        this.mApplogEvent = sharedPreferences.getInt("tt_lite_applog_event", 2);
        this.mShareWay = sharedPreferences.getInt("tt_lite_share_way", 0);
        this.mSwipeBackEnabled = sharedPreferences.getInt("is_gallery_up_return", 1);
        this.mLoadImageWhenFling = sharedPreferences.getInt("tt_lite_fling_load_image", 0);
        this.mEnableLoginTipWhenFirstFavor = sharedPreferences.getInt("tt_lite_first_favor_unlogin", 1);
        String v0 = sharedPreferences.getString("tt_main_back_pressed_refresh_setting", "");
        if (!TextUtils.isEmpty(v0)) {
            try {
                this.mMainBackPressedRefreshSettings = new JSONObject(v0);
            } catch (JSONException v0_1) {
            }
        }

        v0 = sharedPreferences.getString("tt_feed_refresh_settings", "");
        if (!TextUtils.isEmpty(v0)) {
            try {
                this.mFeedRefreshSettingsJson = new JSONObject(v0);
            } catch (JSONException v0_1) {
            }
        }

        this.mFeedShow = sharedPreferences.getInt("tt_enable_stream", 0);
        this.mSSLoadingViewStyle = sharedPreferences.getInt("tt_lite_refresh_loading_view_style", 0);
        this.mLaunchOptFlag = sharedPreferences.getInt("tt_lite_launch_opt_flag", 0);
        v0 = sharedPreferences.getString("tt_lite_silence_refresh", "");
        if (!TextUtils.isEmpty(((CharSequence) v0))) {
            try {
                this.mSilenceRefreshSettings = new JSONObject(v0);
            } catch (JSONException v0_1) {
            }
        }

        this.mFeedPreDrawEnable = sharedPreferences.getBoolean("tt_lite_feed_righttitle_predraw_enable", false);
        this.mWebSearchEnable = sharedPreferences.getInt("tt_lite_web_search_enable", 0);
        v0 = sharedPreferences.getString("tt_lite_search_recommend_enable", "");
        if (!TextUtils.isEmpty(((CharSequence) v0))) {
            try {
                this.mSearchRecommendSettings = new JSONObject(v0);
            } catch (JSONException v0_1) {
            }
        }

        this.mRelatedNewsJumpToTT = sharedPreferences.getInt("tt_majia_related_news_jump_to_tt", 0);
    }

    public void saveData(SharedPreferences.Editor editor) {
        super.saveData(editor);
        editor.putInt("is_gallery_laied_flat", this.mIsGalleryFlat);
        editor.putInt("is_show_watermark", this.mIsShowWatermark);
        editor.putInt("video_multi_resolution_enabled", this.mIsVideoMultiResolutionEnabled);
        editor.putInt("video_play_diagnosis_enabled", this.mIsVideoDiagnosisEnabled);
        editor.putInt("video_detail_comment_button_new", this.mIsVideoRelatedButtonEnabled);
        editor.putInt("video_detail_related_back_stack", this.mIsVideoDetailRelatedBackStackEnabled);
        editor.putInt("video_rec_detail_ad", this.videoRecDetailAd);
        editor.putInt("is_show_big_image_4g", this.mIsLoadImage4G);
        editor.putInt("article_read_position_enable", this.mEnableArticleRecord);
        editor.putInt("enable_lite_immersed_status_bar", this.mIsEnableImmeresedStatusBar);
        editor.putInt("feed_back_with_video_log", this.mIsFeedBackWithVideoLog);
        editor.putInt("tcp_read_time_out", this.mTcpReadTimeOut);
        editor.putInt("video_cdn_statistics", this.mOpenVideoCdnStatistics);
        editor.putInt("video_cdn_module_enable", this.mOpenVideoCdnIpEnable);
        editor.putInt("bold_font_flag", this.mIsTitleBold);
        editor.putInt("open_video_fix_online_question", this.mVideoFixOnLineQuestionFlag);
        editor.putInt("fix_load_more", this.mFixLoadMore);
        editor.putInt("user_refresh_guide_interval", this.mRefreshGuideInterval);
        editor.putInt("user_refresh_guide_type", this.mUserRefreshGuideType);
        editor.putInt("video_finish_new_ui", this.mVideoFinishNewUI);
        editor.putInt("persist_vivo_multi_window", this.mPersisitVivoMultiWindow);
        editor.putInt("video_use_ip_url", this.mVideoUseIpUrl);
        editor.putString("tt_lite_video_auto_play", this.mVideoAutoPlay);
        editor.putInt("tt_lite_update_js", this.mUpdateJs);
        editor.putInt("tt_lite_applog_event", this.mApplogEvent);
        editor.putInt("tt_lite_share_way", this.mShareWay);
        editor.putInt("is_gallery_up_return", this.mSwipeBackEnabled);
        editor.putInt("tt_lite_fling_load_image", this.mLoadImageWhenFling);
        editor.putInt("tt_lite_first_favor_unlogin", this.mEnableLoginTipWhenFirstFavor);
        String v1 = "tt_main_back_pressed_refresh_setting";
        String v0 = this.mMainBackPressedRefreshSettings == null ? "" : this.mMainBackPressedRefreshSettings.toString();
        editor.putString(v1, v0);
        v1 = "tt_feed_refresh_settings";
        v0 = this.mFeedRefreshSettingsJson == null ? "" : this.mFeedRefreshSettingsJson.toString();
        editor.putString(v1, v0);
        editor.putInt("tt_enable_stream", this.mFeedShow);
        editor.putInt("tt_lite_refresh_loading_view_style", this.mSSLoadingViewStyle);
        editor.putInt("tt_lite_launch_opt_flag", this.mLaunchOptFlag);
        v1 = "tt_lite_silence_refresh";
        v0 = this.mSilenceRefreshSettings == null ? "" : this.mSilenceRefreshSettings.toString();
        editor.putString(v1, v0);
        editor.putBoolean("tt_lite_feed_righttitle_predraw_enable", this.mFeedPreDrawEnable);
        editor.putInt("tt_lite_web_search_enable", this.mWebSearchEnable);
        v1 = "tt_lite_search_recommend_enable";
        v0 = this.mSearchRecommendSettings == null ? "" : this.mSearchRecommendSettings.toString();
        editor.putString(v1, v0);
        editor.putInt("tt_majia_related_news_jump_to_tt", this.mRelatedNewsJumpToTT);
    }

    public boolean tryUpdateAppSetting(JSONObject arg5) {
        JSONObject v2_2;
        int v2;
        boolean v0 = super.tryUpdateAppSetting(arg5);
        if (arg5.has("is_gallery_laied_flat")) {
            v2 = arg5.optInt("is_gallery_laied_flat");
            if (v2 != this.mIsGalleryFlat) {
                this.mIsGalleryFlat = v2;
                v0 = true;
            }
        }

        if (arg5.has("is_show_watermark")) {
            v2 = arg5.optInt("is_show_watermark");
            if (v2 != this.mIsShowWatermark) {
                this.mIsShowWatermark = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_multi_resolution_enabled")) {
            v2 = arg5.optInt("video_multi_resolution_enabled");
            if (v2 != this.mIsVideoMultiResolutionEnabled) {
                this.mIsVideoMultiResolutionEnabled = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_play_diagnosis_enabled")) {
            v2 = arg5.optInt("video_play_diagnosis_enabled");
            if (v2 != this.mIsVideoDiagnosisEnabled) {
                this.mIsVideoDiagnosisEnabled = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_detail_comment_button_new")) {
            v2 = arg5.optInt("video_detail_comment_button_new");
            if (v2 != this.mIsVideoRelatedButtonEnabled) {
                this.mIsVideoRelatedButtonEnabled = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_detail_related_back_stack")) {
            v2 = arg5.optInt("video_detail_related_back_stack");
            if (v2 != this.mIsVideoDetailRelatedBackStackEnabled) {
                this.mIsVideoDetailRelatedBackStackEnabled = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_rec_detail_ad")) {
            v2 = arg5.optInt("video_rec_detail_ad");
            if (v2 != this.videoRecDetailAd) {
                this.videoRecDetailAd = v2;
                v0 = true;
            }
        }

        if (arg5.has("is_show_big_image_4g")) {
            v2 = arg5.optInt("is_show_big_image_4g");
            if (v2 != this.mIsLoadImage4G) {
                this.mIsLoadImage4G = v2;
                v0 = true;
            }
        }

        if (arg5.has("article_read_position_enable")) {
            v2 = arg5.optInt("article_read_position_enable");
            if (v2 != this.mEnableArticleRecord) {
                this.mEnableArticleRecord = v2;
                v0 = true;
            }
        }

        if (arg5.has("enable_lite_immersed_status_bar")) {
            v2 = arg5.optInt("enable_lite_immersed_status_bar");
            if (v2 != this.mIsEnableImmeresedStatusBar) {
                this.mIsEnableImmeresedStatusBar = v2;
                v0 = true;
            }
        }

        if (arg5.has("feed_back_with_video_log")) {
            v2 = arg5.optInt("feed_back_with_video_log");
            if (v2 != this.mIsFeedBackWithVideoLog) {
                this.mIsFeedBackWithVideoLog = v2;
                v0 = true;
            }
        }

        if (arg5.has("tcp_read_time_out")) {
            v2 = arg5.optInt("tcp_read_time_out");
            if (v2 != this.mTcpReadTimeOut) {
                this.mTcpReadTimeOut = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_cdn_statistics")) {
            v2 = arg5.optInt("video_cdn_statistics");
            if (v2 != this.mOpenVideoCdnStatistics) {
                this.mOpenVideoCdnStatistics = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_cdn_module_enable")) {
            v2 = arg5.optInt("video_cdn_module_enable");
            if (v2 != this.mOpenVideoCdnIpEnable) {
                this.mOpenVideoCdnIpEnable = v2;
                v0 = true;
            }
        }

        if (arg5.has("bold_font_flag")) {
            v2 = arg5.optInt("bold_font_flag");
            if (v2 != this.mIsTitleBold) {
                this.mIsTitleBold = v2;
                v0 = true;
            }
        }

        if (arg5.has("open_video_fix_online_question")) {
            v2 = arg5.optInt("open_video_fix_online_question");
            if (v2 != this.mVideoFixOnLineQuestionFlag) {
                this.mVideoFixOnLineQuestionFlag = v2;
                v0 = true;
            }
        }

        if (arg5.has("fix_load_more")) {
            v2 = arg5.optInt("fix_load_more");
            if (v2 != this.mFixLoadMore) {
                this.mFixLoadMore = v2;
                v0 = true;
            }
        }

        if (arg5.has("user_refresh_guide_interval")) {
            v2 = arg5.optInt("user_refresh_guide_interval");
            if (v2 != this.mRefreshGuideInterval) {
                this.mRefreshGuideInterval = v2;
                v0 = true;
            }
        }

        if (arg5.has("user_refresh_guide_type")) {
            v2 = arg5.optInt("user_refresh_guide_type");
            if (v2 != this.mUserRefreshGuideType) {
                this.mUserRefreshGuideType = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_finish_new_ui")) {
            v2 = arg5.optInt("video_finish_new_ui");
            if (v2 != this.mVideoFinishNewUI) {
                this.mVideoFinishNewUI = v2;
                v0 = true;
            }
        }

        if (arg5.has("persist_vivo_multi_window")) {
            v2 = arg5.optInt("persist_vivo_multi_window");
            if (v2 != this.mPersisitVivoMultiWindow) {
                this.mPersisitVivoMultiWindow = v2;
                v0 = true;
            }
        }

        if (arg5.has("video_use_ip_url")) {
            v2 = arg5.optInt("video_use_ip_url");
            if (v2 != this.mVideoUseIpUrl) {
                this.mVideoUseIpUrl = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_video_auto_play")) {
            String v2_1 = arg5.optString("tt_lite_video_auto_play");
            if (!v2_1.equals(this.mVideoAutoPlay)) {
                this.mVideoAutoPlay = v2_1;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_update_js")) {
            v2 = arg5.optInt("tt_lite_update_js");
            if (v2 != this.mUpdateJs) {
                this.mUpdateJs = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_applog_event")) {
            v2 = arg5.optInt("tt_lite_applog_event");
            if (v2 != this.mApplogEvent) {
                this.mApplogEvent = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_share_way")) {
            v2 = arg5.optInt("tt_lite_share_way");
            if (v2 != this.mShareWay) {
                this.mShareWay = v2;
                v0 = true;
            }
        }

        if (arg5.has("is_gallery_up_return")) {
            v2 = arg5.optInt("is_gallery_up_return");
            if (v2 != this.mSwipeBackEnabled) {
                this.mSwipeBackEnabled = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_fling_load_image")) {
            v2 = arg5.optInt("tt_lite_fling_load_image");
            if (v2 != this.mLoadImageWhenFling) {
                this.mLoadImageWhenFling = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_first_favor_unlogin")) {
            v2 = arg5.optInt("tt_lite_first_favor_unlogin");
            if (v2 != this.mEnableLoginTipWhenFirstFavor) {
                this.mEnableLoginTipWhenFirstFavor = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_main_back_pressed_refresh_setting")) {
            v2_2 = arg5.optJSONObject("tt_main_back_pressed_refresh_setting");
            if (!this.jsonEquals(v2_2, this.mMainBackPressedRefreshSettings)) {
                this.mMainBackPressedRefreshSettings = v2_2;
                v0 = true;
            }
        }

        if (arg5.has("tt_feed_refresh_settings")) {
            v2_2 = arg5.optJSONObject("tt_feed_refresh_settings");
            if (!this.jsonEquals(v2_2, this.mFeedRefreshSettingsJson)) {
                this.mFeedRefreshSettingsJson = v2_2;
                v0 = true;
            }
        }

        if (arg5.has("tt_enable_stream")) {
            v2 = arg5.optInt("tt_enable_stream");
            if (v2 != this.mFeedShow) {
                this.mFeedShow = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_refresh_loading_view_style")) {
            v2 = arg5.optInt("tt_lite_refresh_loading_view_style");
            if (v2 != this.mSSLoadingViewStyle) {
                this.mSSLoadingViewStyle = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_launch_opt_flag")) {
            v2 = arg5.optInt("tt_lite_launch_opt_flag");
            if (v2 != this.mLaunchOptFlag) {
                this.mLaunchOptFlag = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_silence_refresh")) {
            v2_2 = arg5.optJSONObject("tt_lite_silence_refresh");
            if (!this.jsonEquals(v2_2, this.mSilenceRefreshSettings)) {
                this.mSilenceRefreshSettings = v2_2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_feed_righttitle_predraw_enable")) {
            boolean v2_3 = arg5.optBoolean("tt_lite_feed_righttitle_predraw_enable");
            if (v2_3 != this.mFeedPreDrawEnable) {
                this.mFeedPreDrawEnable = v2_3;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_web_search_enable")) {
            v2 = arg5.optInt("tt_lite_web_search_enable");
            if (v2 != this.mWebSearchEnable) {
                this.mWebSearchEnable = v2;
                v0 = true;
            }
        }

        if (arg5.has("tt_lite_search_recommend_enable")) {
            v2_2 = arg5.optJSONObject("tt_lite_search_recommend_enable");
            if (!this.jsonEquals(v2_2, this.mSearchRecommendSettings)) {
                this.mSearchRecommendSettings = v2_2;
                v0 = true;
            }
        }

        if (arg5.has("tt_majia_related_news_jump_to_tt")) {
            v2 = arg5.optInt("tt_majia_related_news_jump_to_tt");
            if (v2 != this.mRelatedNewsJumpToTT) {
                this.mRelatedNewsJumpToTT = v2;
                v0 = true;
            }
        }

        return v0;
    }
}

